/**
 * Created by 45865 on 2020/5/22.
 */
var allcookies = document.cookie;
var user_pos = allcookies.indexOf("loginName");

var loginName
var pwd

if (user_pos != -1){
    user_pos = user_pos + "loginName".length + 1;
    var user_end = allcookies.indexOf(";",user_pos);
    if (user_end == -1){
        user_end = allcookies.length;
    }
    loginName = unescape(allcookies.substring(user_pos,user_end));
    $('input[name="user"]').val(loginName)
    console.log(loginName);
}

var pwd_pos = allcookies.indexOf("pwd");

if (pwd_pos != -1){
    pwd_pos = pwd_pos + "pwd".length + 1;
    var pwd_end = allcookies.indexOf(";",pwd_pos);
    if (pwd_end == -1){
        pwd_end = allcookies.length;
    }
    pwd = unescape(allcookies.substring(pwd_pos,pwd_end));
    $('input[name="pwd"]').val(pwd)
    console.log(pwd);
}

if (loginName && pwd){
    login(loginName,pwd)
}